package com.yw.android.common.base;

import android.content.Context;

import io.reactivex.disposables.CompositeDisposable;


public abstract class BasePresenter<T, E> {
    public Context mContext;
    public E mModel;
    public T mView;
    public CompositeDisposable mCompositeDisposable;

    public void setVM(T v, E m) {
        this.mView = v;
        this.mModel = m;
        this.onStart();
    }

    public void onStart() {
        if (mCompositeDisposable == null)
            mCompositeDisposable = new CompositeDisposable();
    }

    public void onStop() {
        if (mCompositeDisposable != null) {
            mCompositeDisposable.clear();
        }
    }
}
